# chr ord
print(chr(65))
print(ord('A'))
print(ord('下'))

print(chr(19979))
print('-------------------------------------------')
# print() input() list() str() set() dict() tuple()
# int() chr() ord() bin() hex() oct() isinstance()

# 加密算法 md5 sha1 sha256
# base64
import  hashlib

msg = '张三去吃饭'
md5 = hashlib.md5(msg.encode('utf-8'))
print(md5.hexdigest())
print(len(md5.hexdigest()))

sha1 = hashlib.sha1(msg.encode('utf-8'))
print(sha1.hexdigest())
print(len(sha1.hexdigest()))

sha256 = hashlib.sha256(msg.encode('utf-8'))
print(sha256.hexdigest())
print(len(sha256.hexdigest()))

password = '123456'

list1 = []

sha256 = hashlib.sha256(password.encode('utf-8'))
list1.append(sha256.hexdigest())

pwd = input('请输入密码：')
sha256 = hashlib.sha256(pwd.encode('utf-8'))
pwd = sha256.hexdigest()
for i in list1:
    if pwd == i:
        print('密码正确')
